const { Application } = require("egg");
const { app } = require("egg-mock");

module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
    const expSchema = new Schema({
        // 用户名
        username: {type: String, default: '' },
        // 用户唯一标识，通过这个把数据绑定给某个用户
        openid: { type: String },
        // 预计收入
        exp_income: { type: Number, default: 0 },
        // 预计房租
        exp_rent: { type: Number, default: 0 },
        // 预计水电
        exp_hyd: { type: Number, default: 0 },
        // 预计吃喝
        exp_lunch: { type: Number, default: 0 },
        // 预计其他
        exp_other: { type: Number, default: 0 },
        // 预计收入
        exp_balance: { type: Number, default: 0 },
        // 当前余额
        balance: { type: Number, default: 0 }
    });
    return mongoose.model('Expect', expSchema);  //返回model
}